package com.coreservlets.jsf.ss07;

import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

public class ColorUtils 
{
	private static ColorSpec[] colors = { new ColorSpec("Red", "red"), new ColorSpec( "Green", "green"), new ColorSpec( "Blue", "blue"), new ColorSpec( "Yellow", "yellow"), 
									   new ColorSpec( "Black", "black"), new ColorSpec("Gray", "gray") };
	
	public static List< SelectItem > colorNames;
	
	static
	{
		colorNames = new ArrayList<SelectItem>();
		
		for (ColorSpec colorSpec : colors) 
		{
			colorNames.add( new SelectItem( colorSpec.getColorName() ));
		}
	}
	
	public static List< SelectItem > getColorNames()
	{
		return( colorNames );
	}
	
	public static ColorSpec[] getColors()
	{
		return( colors );
	}
}
